package com.maybach.workflow.core.config.parser;


import com.maybach.workflow.common.api.node.BaseNode;
import com.maybach.workflow.common.api.node.EndNode;
import org.w3c.dom.Element;

/**
 * Created by well on 15/6/11.
 */
public class EndParser implements Parser{
    public String nodeName = NodeParser.NODE_NAME_END;


    @Override
    public BaseNode parse(Element element) {
        if(element == null){
            return null;
        }
        if(!nodeName.equalsIgnoreCase(element.getNodeName())){
            return null;
        }
        EndNode endNode = new EndNode();

        endNode.setName(element.getAttribute(NodeParser.ATTR_NAME));
        endNode.setDisplayName(element.getAttribute(NodeParser.ATTR_DISPLAYNAME));
        endNode.setHandlers(element.getAttribute(NodeParser.ATTR_HANDLERS));
        check(endNode);
        return endNode;
    }

    public void check(EndNode endNode){

    }
}
